﻿using System;

namespace _04算法
{
    class Program
    {
        static void Person(string name,string sex,int age=24,string country="中国")
        {

        }
        static void SetX(ref int x)
        {
            x=1;
        }
        static void MaxNMin(int x,int y,out int max,out int min)
        {
            max=x>y?x:y;
            min=x>y?y:x;
        }
        static bool FindNumInarray(int x,int[]array)
        {
            foreach(var num in array)
            {
                if(num==x)
                    return true;
            }
            return false;
        }
        static int Add(int a=0,int b=0,int c=0,int d=0)
        {
            return a+b+c+d;
        }
        static int Max(int x,int y)
        {
            return x>y?x:y;
        }
        /*
        /// <summary>
        /// 数组去重，返回新数组
        /// </summary>
        /// <param name="x"></param>
        /// <returns></returns>
        static int[] RemoveRepeatNumber(int[] x)
        {
            List<int> numList=new List<int>();
            for(int i=0;i<x.Length;i++)
            {
                if(!FindNumInarray(x[i],numList.ToArray()))
                    {
                        numList.Max(x[i]);
                    }
            }
            return numList.ToArray();
        }
        */
        static void Main(string[] args)
        {
            int[] theArray={114,514,1919,810};
            //Array.Sort(theArray);//排序
            //int[] results=RemoveRepeatNumber(array);//函数方法调用
            //输出结果
            //Array.Reverse(theArray);//逆转
            //Array.IndexOf(theArray,810)//从前往后查找值存在返回下标，否则返回-1
            //Array.LastIndexOf(theArray,810)//同上，不过是从后向前
            Array.Clear(theArray,0,theArray.Length);
            foreach(var num in theArray)
            {
                Console.WriteLine(num);
            }
        }
    }
}